/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package contest.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *
 * @author hongnhung
 */
public class DateUtil {

    public static final String FORMAT_PATTERN_VIEW = PropertiesBundle.CONSTANT.getString("view_date");
    public static final String FORMAT_PATTERN_SQL = PropertiesBundle.CONSTANT.getString("sql_date");



    public static Date getCurrentDate() throws ParseException{
       return new Date();
    }


    public static String formatDateView(Date date){
        SimpleDateFormat dateFormat = new SimpleDateFormat(FORMAT_PATTERN_VIEW);
        return dateFormat.format(date);
    }

    public static String formatDateSQL(Date date){
        SimpleDateFormat dateFormat = new SimpleDateFormat(FORMAT_PATTERN_SQL);
        return dateFormat.format(date);
    }

}
